package com.business.business.controller;

import com.business.business.entity.OepreStore;
import com.business.business.entity.Result;
import com.business.business.service.OePreStoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
@RequestMapping("page")
public class StoreController {



    @Autowired
    private OePreStoreService oePreStoreService;



    @GetMapping("/showme")
    public Result showMe(@RequestParam int id) {

        System.out.println("================================================="+id);

        List<OepreStore> oplist =oePreStoreService.findOepreStoreByVouserid(id);

        if (oplist.isEmpty()){

            return Result.errorMsg("您还没有商户");
        }


        return Result.ok(oplist);
    }
}
